Minor cleanups in geo's new reader.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 25 Mar 2013 02:06:13 +0000 (02:06 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 25 Mar 2013 02:06:13 +0000 (02:06 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4365 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/geo.cc

index f77136f289e45f1034694aa40b1776054a2df7fe..09d1c9235baaa210e11de90f3e04d0b88e810832 100644 (file)
@@ -57,6 +57,10 @@ char * ShimString(QString s)
 {
   return xstrdup(s.toUtf8().data());
 }
+char * ShimString(QStringRef s) 
+{
+  return xstrdup(s.toString().toUtf8().data());
+}
 
 double ShimAttributeDouble(QXmlStreamAttributes a, QString v) 
 {
@@ -78,7 +82,7 @@ void GeoReadLoc()
       }
       if (reader.name() == "name") {
         QXmlStreamAttributes a = reader.attributes();
-        wpt->shortname = ShimString(a.value("id").toString());
+        wpt->shortname = ShimString(a.value("id"));
         wpt->description = ShimString(reader.readElementText());
       }
       if (reader.name() == "coord") {
@@ -327,7 +331,6 @@ void wpt_container(const char* args, const char** unused)
   }
   waypt_alloc_gc_data(wpt_tmp)->container = v;
 }
-#endif
 void wpt_diff(const char* args, const char** unused)
 {
   if (!args) {
@@ -343,6 +346,7 @@ void wpt_terr(const char* args, const char** unused)
   }
   waypt_alloc_gc_data(wpt_tmp)->terr = atof(args) * 10;
 }
+#endif
 
 static void
 geo_rd_init(const char* fname)